


local ui = class.panel.create('',1283,748,80,80)
ac['专属UI'] = ui
ui:hide()
ui:add_frame('tooltip_backdrop0')

local button = ui:add_sp_button(8,8,64,64,1)
local text = button:add_text('+6',0,5,button.w-10,20,12,6)
text:set_color(0xff00ff00)
button:set_highlight([[UI\Widgets\BattleNet\bnet-button01-highlight-mouse.blp]])


function button:on_button_mouse_enter()
    local skill = self.skill
    if skill then
        local tool = ui:skill_tooltip(skill,'top')
        tool.enter_button = self
    end
end

function button:on_button_clicked(button)
    ac.sync('同步-升级专属')
end

ac.game:event '玩家-更新专属'(function(_,player,skill)
    if player:is_self() then
        button.skill = skill
        text:set_text(('+%0.f'):format(skill.index))
        ui:show()
    end
end)

--ui:add_drag_button()